﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Demo
{
    class SumUtils
    {
        public void count(int a,int b)
        {
            Console.WriteLine("{0}相加{1}等于{2}", a, b, a + b);
        }
        public void count(double a,double b)
        {
            Console.WriteLine("{0}相加{1}等于{2}", a, b, a + b);
        }
        public void count(string a,string b)
        {
            Console.WriteLine("{0}相加{1}等于{2}", a, b, a + b);
        }
        public void count(int c)
        {
            int sum = 0;
            for (int i = 1; i <= c; i++)
            {
                sum += i;
            }
            Console.WriteLine("从 1 到{0}的和为：{1}",c,sum);
        }
    }
}
